<template>
 <model-page>
	<Table 
	:headList="headList"
	:tableData="tableData"
	:total="total" 
	 v-model:pageNum="postData.pageNum"
	:pageSize="postData.pageSize"
	 @checkPage="checkPage"
	></Table> 
 </model-page>
</template>

<script setup>
import Table from '@/component/Table.vue'
import {ref} from 'vue'
import {recordListToday} from '@/api/dataInt.js'
const headList = ref([
		{
			title:"所属楼栋",
			props:"buildingName",
			width:"18%"
		},
		{
			title:"所属楼层",
			props:"floorName",
			width:"18%"
		},
		{
			title:"房间号",
			props:"roomNumber",
			width:"14%"
		},
		{
			title:"床号",
			props:"bedNumber",
			width:"10%"
		},
		{
			title:"老人名",
			props:"elderName",
			width:"12%"
		},
		{
			title:"录入时间",
			props:"createTime",
			width:"18%"
		},
])
// 切换分页
const checkPage = (type)=>{
	getTableList()
}
const tableData = ref([])
const postData =ref({
	pageNum:1,
	pageSize:10,
})
const total = ref(0)
// 获取表格数据
const getTableList = async()=>{
	try{
	const {code,data:res} = await recordListToday(postData)
	if(code === 200){
		total.value = res.total
		tableData.value = res.list
	}
	}catch(e){
		//TODO handle the exception
	}
}
getTableList()
</script>

<style>

</style>
